/**
 * elancom Corporation copy right 2012 - 2015  
 *   
 * $Header: https://192.168.1.224/svn/elancom/product/elancom-platform/trunk/src/main/java/com/elancom/framework/component/Message.java 1034 2012-07-02 03:09:12Z lanzhouxue $
 * $Id: Message.java 1034 2012-07-02 03:09:12Z lanzhouxue $
 * $Author: lanzhouxue $
 * $Date: 2012-07-02 11:09:12 +0800 (Mon, 02 Jul 2012) $
 * $Revision: 1034 $
 */
package com.elancom.framework.component;

import java.io.Serializable;

/**
 * @author elancom
 * @date Apr 28, 2012
 */
public class Message implements Comparable<Message>, Serializable {
	private static final long serialVersionUID = -4296120019561207951L;

	private String key;

	private String content;

	private int order;

	public Message() {
		super();
	}

	public Message(String key, String content) {
		super();
		this.key = key;
		this.content = content;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getOrder() {
		return order;
	}

	public Message setOrder(int order) {
		this.order = order;
		return this;
	}

	@Override
	public int compareTo(Message o) {
		return o.order - order;
	}

	@Override
	public String toString() {
		return "[" + key + "," + content + "," + order + "]";
	}
}
